


<script type="text/html" data-template-name="LW Send">
    <!-- 设置第一行为Name -->
    <div class="form-row">
        <label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="lora.lorawan_send.name"></span></label>
        <input type="text" id="node-input-name" data-i18n="[placeholder]lora.lorawan_send.name">
    </div>

    <div class="form-row">
        <label for="node-input-devEUI"><i class="fa fa-globe"></i> deveui</label>
        <input type="text" id="node-input-devEUI">
    </div>
    <div class="form-row">
        <label for="node-input-confirmed"><i class="fa fa-globe"></i> confirmed</label>
        <input type="text" id="node-input-confirmed">
    </div>
    <div class="form-row">
        <label for="node-input-fport"><i class="fa fa-globe"></i> FPort</label>
        <input type="text" id="node-input-fport">
    </div>
</script>




<script type="text/javascript">
    RED.nodes.registerType('LW Send',{
        category: 'LoRaWAN',
        color: '#ff9047',
        defaults: {
            name: {value: ""},
            devEUI: { value: "", required: true, validate: RED.validators.regex(/^[A-Za-z0-9]{16}$/) },
            confirmed: {value: false},
            fport: {value: "22"}
        },
        inputs:1,
        outputs:0,
        icon: "bridge.svg",
        align: "right",
        label: function() {
            return this.name||this._("lora.lorawan_send.Label_0_dragOut");
        },


        oneditprepare: function() {

            var node = this;

            $("#node-input-confirmed").typedInput({
                types: [
                    {
                        value: "confirmed",
                        options: [
                            { value: "false", label: "False" },
                            { value: "true", label: "True" },
                        ]
                    }
                ],
            })
        },
        
    });
</script>